#include<stdlib.h>
#include<stdio.h>
#define N 22
int flag[N][N][N];

int w(int a ,int b,int c){
    int x,y,z,k;
    if(a<=0 || b<=0 || c<=0)
        return 1;
    else if(a>20 || b>20 || c>20){
        if(flag[20][20][20]==-1)
            flag[20][20][20] = w(20,20,20);
        return flag[20][20][20];
    }
    else if(a<b && b<c){

        if(flag[a][b][c-1]== -1){
            x = w(a,b,c-1);
            flag[a][b][c-1] = x;
        }else{
            x = flag[a][b][c-1];
        }

        if(flag[a][b-1][c-1]== -1){
            y = w(a,b-1,c-1);
            flag[a][b-1][c-1]  = y;
        }else{
            y = flag[a][b-1][c-1];
        }

        if(flag[a][b-1][c]== -1){
            z = w(a,b-1,c);
            flag[a][b-1][c] = z;
        }else{
            z =  flag[a][b-1][c];
        }
        return x + y - z;
    }else{
        if(flag[a-1][b][c]==-1){
            x =  w(a-1,b,c) ;
            flag[a-1][b][c] = w(a-1,b,c);
        }else
            x = flag[a-1][b][c];

        if(flag[a-1][b-1][c]== -1){
            k = w(a-1,b-1,c);
            flag[a-1][b-1][c] = k;
        }else
            k = flag[a-1][b-1][c];

        if(flag[a-1][b][c-1]==-1){
            y = w(a-1,b,c-1);
            flag[a-1][b][c-1] = y;
        }else
            y =  flag[a-1][b][c-1];

        if(flag[a-1][b-1][c-1]==-1){
            z = w(a-1,b-1,c-1);
            flag[a-1][b-1][c-1] = z;
        }else
            z = flag[a-1][b-1][c-1];
        return x + k + y - z;
    }
}
int main(){
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    while(a!=-1 || b!=-1 || c!=-1){
        memset(flag,-1,sizeof(flag));
        printf("w(%d, %d, %d) = %d\n",a,b,c,w(a,b,c));
        scanf("%d %d %d",&a,&b,&c);
    }
    return 0;
}
